import moment from 'moment'
export const rosterListThead = [
  {
    type: 'selection',
    minWidth: 60,
    align: 'center'
  },
  {
    title: '姓名',
    minWidth: 150,
    tooltip: true,
    key: 'name',
    render: (h, params) => {
      var text = params.row.name
      const color = params.row.beHiring === false ? 'red' : ''
      return h('span', {
        domProps: {
          style: 'color: ' + color
        }
      }, text)
    }
  },
  {
    title: '身份证号码',
    minWidth: 200,
    key: 'idCardNo',
    render: (h, params) => {
      var text = params.row.idCardNo
      const color = params.row.beHiring === false ? 'red' : ''
      return h('span', {
        domProps: {
          style: 'color: ' + color
        }
      }, text)
    }
  },
  {
    title: '性别',
    minWidth: 80,
    key: 'sex',
    render: (h, params) => {
      const text = params.row.sex === 1 ? '男' : params.row.sex === 2 ? '女' : '未知'
      return h('span', text)
    }
  },
  {
    title: '手机号码',
    minWidth: 150,
    key: 'phone'
  },
  {
    title: '在职状态',
    minWidth: 100,
    key: 'beHiring'
  },
  {
    title: '公司名称',
    minWidth: 200,
    key: 'companyName'
  },
  {
    title: '部门',
    minWidth: 150,
    key: 'department'
  },
  {
    title: '职业',
    minWidth: 150,
    key: 'duty'
  },
  {
    title: '工资卡开户行',
    minWidth: 150,
    key: 'bankName'
  },
  {
    title: '工资卡卡号',
    minWidth: 180,
    key: 'accountNo'
  },
  {
    title: '工资发放银行',
    minWidth: 150,
    key: 'salaryBank'
  },
  {
    title: '入职时间',
    minWidth: 150,
    key: 'onBoardingDate',
    render: (h, params) => {
      let row = params.row
      let times = row.onBoardingDate ? moment(row.onBoardingDate).format('YYYY-MM-DD') : ''
      return h('span', times)
    }
  },
  {
    title: '创建时间',
    minWidth: 180,
    key: 'createTime',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.createTime) {
        times = row.createTime.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  },
  {
    title: '在保种类',
    minWidth: 180,
    key: 'serviceType',
    // slot: 'serviceType',
  },
  {
    title: '操作',
    minWidth: 360,
    align: 'center',
    key: 'action',
    slot: 'action',
    fixed: 'right'
  }
]



export const EmployeeBookListThead = [
  {
    type: 'selection',
    minWidth: 60,
    align: 'center',
    fixed: 'left'
  },
  {
    title: '姓名',
    minWidth: 150,
    tooltip: true,
    key: 'name',
    render: (h, params) => {
      var text = params.row.name
      const color = params.row.beHiring === false ? 'red' : ''
      return h('span', {
        domProps: {
          style: 'color: ' + color
        }
      }, text)
    },
    fixed: 'left'
  },
  {
    title: '身份证号码',
    minWidth: 200,
    key: 'idCardNo',
    render: (h, params) => {
      var text = params.row.idCardNo
      const color = params.row.beHiring === false ? 'red' : ''
      return h('span', {
        domProps: {
          style: 'color: ' + color
        }
      }, text)
    },
    fixed: 'left'
  },
  {
    title: '性别',
    minWidth: 80,
    key: 'sex',
    render: (h, params) => {
      const text = params.row.sex === 1 ? '男' : params.row.sex === 2 ? '女' : '未知'
      return h('span', text)
    }
  },
  {
    title: '手机号码',
    minWidth: 150,
    key: 'phone'
  },
  {
    title: '在职状态',
    minWidth: 120,
    key: 'beHiring'
  },
  {
    title: '公司名称',
    minWidth: 240,
    key: 'companyName'
  },
  {
    title: '部门',
    minWidth: 150,
    key: 'department'
  },
  {
    title: '职业',
    minWidth: 150,
    key: 'duty'
  },
  {
    title: '工资卡开户行',
    minWidth: 150,
    key: 'bankName'
  },
  {
    title: '工资卡卡号',
    minWidth: 180,
    key: 'accountNo'
  },
  {
    title: '工资发放银行',
    minWidth: 150,
    key: 'salaryBank'
  },
  {
    title: '入职时间',
    minWidth: 150,
    key: 'onBoardingDate',
    render: (h, params) => {
      let row = params.row
      let times = row.onBoardingDate ? moment(row.onBoardingDate).format('YYYY-MM-DD') : ''
      return h('span', times)
    }
  },
  {
    title: '创建时间',
    minWidth: 180,
    key: 'createTime',
    render: (h, params) => {
      let row = params.row
      let times = ''
      if (row.createTime) {
        times = row.createTime.slice(0, 19).replace(/T/g, ' ')
      }
      return h('span', times)
    }
  },
  {
    title: '在保种类',
    minWidth: 180,
    key: 'serviceType',
    // slot: 'serviceType',
  },
  {
    title: '操作',
    minWidth: 200,
    align: 'center',
    key: 'action',
    slot: 'action',
    fixed: 'right'
  }
]
